package com.pagoda.nerp.webapi.controller;

import com.pagoda.nerp.web.common.buildTree.Tree;
import com.pagoda.nerp.web.common.buildTree.TreeBuild;
import com.pagoda.nerp.web.entities.HRORGPost;
import com.pagoda.nerp.web.services.HRORGPostService;
import com.pagoda.nerp.webapi.hander.ResponseResult;
import org.hibernate.loader.custom.Return;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.pagoda.nerp.erpgwehrApplication.posttree;

@RestController
public class HRORGPostController {
    @Autowired
    private HRORGPostService hrorgPostService;

    @GetMapping("/getHRPostTree")
    public ResponseResult getHRORGPostTree(@RequestParam(value = "id",required = false, defaultValue = "901205ca-6c22-4ee7-ae4b-96cc7165d07f") String rootid){
        return posttree;
    }

    @GetMapping("/updatehrpost")
    public ResponseResult test(){
        List<HRORGPost> list = hrorgPostService.updateDBPost();
        return ResponseResult.success(list);
    }
}
